Executable and Linkable Format (ELF), is the default binary format on Linux-based systems.
Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import url("https://fonts.googleapis.com/css?family=Roboto+Slab:100,300,400,700"); | |
@import url("https://fonts.googleapis.com/css?family=Raleway:300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i"); | |
* { | |
margin: 0; | |
border: 0; | |
box-sizing: border-box; | |
} | |
:root { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script will explain how to transfer a file to EC2 using SSM ONLY! | |
# You will need to have permission to run SSM commands on the target machine and have sudo access as well | |
# Infos | |
INSTANCE_ID=i-1234567890 | |
FILE_NAME=the_file.tar.gz | |
# Step 1: Run command on machine to install netcat and dump from port to filename | |
# < Start session |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -c --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/12.0.2+10/e482c34c86bd4bf8b56c0b35558996b9/jdk-12.0.2_linux-x64_bin.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Explanation file: db.js | |
This code imports the mongoose library which allows to connect to a MongoDB database. | |
There are two URIs defined to connect to two different databases: MONGO_URI and MOBILE_URI. | |
Each URI contains connection information to a remote MongoDB database, including user credentials. | |
The connectDBs function uses the mongoose.createConnection method to create connections to these two | |
databases using the respective URIs. The useUnifiedTopology and useNewUrlParser options are set to enable the new | |
unified topology policy and use MongoDB's new URL parser, respectively. | |
The function returns an object that contains the connections to these two databases as qrCodeDb and userDB properties. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @see https://docs.aws.amazon.com/ja_jp/AmazonCloudFront/latest/DeveloperGuide/LocationsOfEdgeServers.html | |
# @see https://morizyun.github.io/ruby/rails-controller-get-ip.html | |
# @see https://dev.classmethod.jp/cloud/aws/get-ec2-public-ip-range-by-powershell/ | |
# @see https://github.com/rails/rails/blob/c81af6a/actionpack/lib/action_dispatch/middleware/remote_ip.rb#L112-L150 | |
Rails.application.configure do | |
ip_ranges_res = Faraday.get('https://ip-ranges.amazonaws.com/ip-ranges.json') | |
ip_ranges = JSON.parse(ip_ranges_res.body) | |
cloudfront_ips = ip_ranges['prefixes'].select { |v| v['service'] == 'CLOUDFRONT' }.map { |v| IPAddr.new(v['ip_prefix']) } + | |
ip_ranges['ipv6_prefixes'].select { |v| v['service'] == 'CLOUDFRONT' }.map { |v| IPAddr.new(v['ipv6_prefix']) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- add this to your header --> | |
<div id="google_translate_element"></div> | |
<!-- to your js part --> | |
<script src="script.js"></script> | |
<script type="text/javascript"> | |
function googleTranslateElementInit() { | |
new google.translate.TranslateElement( | |
{pageLanguage: 'en'}, | |
'google_translate_element' |
On an Debian/Ubuntu-based system, to install texlive-full
without docs and language packs, simply do this:
sudo apt install `sudo apt --assume-no install texlive-full | \
awk '/The following additional packages will be installed/{f=1;next} /Suggested packages/{f=0} f' | \
tr ' ' '\n' | grep -vP 'doc$' | grep -vP 'texlive-lang' | grep -vP 'latex-cjk' | tr '\n' ' '`
After this, if you wish to install the language packs, selectively install them. E.g.:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
list of currencies currently in circulation | |
taken from http://www.currency-iso.org/iso_index/iso_tables/iso_tables_a1.htm | |
http://www.iso.org/iso/currency_codes_list-1.html | |
2011-08-11 | |
""" |
NewerOlder